package controllers.zen;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import controllers.SuperServlet;

import appmodel.ZenAppModel;

@SuppressWarnings("serial")
public class CambiarJardinServlet extends SuperServlet {
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		makeGameInstance(request);
		
		ZenAppModel app = getJardinZen(request);
		app.irAlOtroJardin();
		
		// Guardo el estado que quiero comunicar a la vista
		request.setAttribute("plantas", app.getJardinZen());
		
		// Delego a la vista
		request.getRequestDispatcher("jardinzen.jsp").forward(request, response);
	}
}
